package org.dromara.admin.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.admin.domain.model.UserRegisterBody;
import org.dromara.admin.service.IRegisterService;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.model.RegisterBody;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 后台注册
 *
 * @author Lion Li
 */
@Slf4j
@SaIgnore
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin")
public class AdminRegisterController {

    private final IRegisterService registerService;

    /**
     * 注册公司
     */
//    @ApiEncrypt
    @PostMapping("/registerCompany")
    public R<Void> register(@Validated @RequestBody UserRegisterBody user) {
        registerService.registerCompany(user);
        return R.ok();
    }

}
